import Vue from "vue";
import App from "./App.vue";
import router from "./router/index";
import ElementUI, { Main } from "element-ui";
// ==========================
import storageUtils from "./utils/storageUtils";
import memoryUtils from "./utils/memoryUtils";
import "element-ui/lib/theme-chalk/index.css";
import "./permission";
// 引入vuex
import store from "./store/index";
// 富文本编辑框
// import tinymce from "tinymce";
// import vueTinymce from "@packy-tang/vue-tinymce";
// 程序加载获取用户信息
// Vue.prototype.$tinymce = tinymce
// Vue.use(vueTinymce);
// 引入echarts
import jquery from "jquery";
import * as echarts from "echarts";
var user = storageUtils.getUser();
// console.log(user.hasOwnProperty("username"));
if (!user.hasOwnProperty("username")) {
  // console.log(sessionStorage.getItem("USE_KEY"));
  user = JSON.parse(sessionStorage.getItem("USE_KEY"));
  // console.log(user);
}
// console.log(user);
if (user && user._id) {
  memoryUtils.user = user;
}
Vue.prototype.$echarts = echarts;
Vue.config.productionTip = false;
Vue.use(ElementUI);
Vue.prototype.$ = jquery;


new Vue({
  router,
  store,
  el: "#app",
  render: (h) => h(App),
});
// new Vue({
// router,
//   render: (h) => h(App),
// }).$mount("#app");
